1. Field of the Invention
This invention relates to computers and more particularly to addressing of computer peripherals and memories.
2. Description of the Related Art
In a typical microcontroller design, various chip select signals are available that indicate that an address is within a particular address range and can be used to select a particular device. An example of such a microcontroller is the AM186.TM.ES which is compatible with the 80186 microcontroller. Details of one example of a '186 microcontroller can be found in the Advanced Micro Devices data sheets for the AM186.TM.ES (Publication #20002; Rev. A; Amendment/0; Issue Date: January 1996), the Am186.TM.EM and Am188.TM.EM (Publication #19168 Rev. D Amendment /0; Issue Date: January 1996) and the "Am186.TM.EM/188.TM.EM/188.TM.EMUser's Manual with Am 186 Family Instruction Definitions, " which are incorporated herein by reference.
In the AM186.TM.ES, the available chip selects include an upper memory chip select (UCS). UCS is used for the upper address space and in the AM186.TM.ES has a block size varying from 64 Kbytes to 512 Kbytes and an ending address of FFFFFh. A lower memory chip select (LCS) indicates an address in the lower memory region with a starting address of 00000h In the AM186.TM.ES, the block size for LCS can range from 64 Kbytes to 512 Kbytes. Midrange chip selects with programmable starting addresses and block sizes are also available. The peripheral chip selects (PCS) provide additional capability to select peripheral devices and they can be programmed to reside anywhere in the 1 Mbyte address space of the '186. The block size of the peripheral chip selects is small relative to LCS and UCS and can be e.g., 256 bytes.
However, PCS address space in typical '186 microcontrollers is mutually exclusive with the address space of other chip selects such as LCS or UCS. Thus, if PCS is mapped into the lower or upper address space, large amounts of address space is lost. For example, if PCS is mapped into a 256 byte block starting at address 40000h, then the maximum memory size for LCS is 256 Kbytes (0 to 3FFFF). The address space from 40000-7FFFF can not be used for LCS. Thus, a 256 byte address space for LCS caused the sacrifice of almost 256 Kbytes of address space.
In prior '186 microcontrollers, if PCS address space was overlapped with a UCS (or LCS) address space, several unwanted things could take place. Referring to FIG. 1, two devices, such as UCS device 101 and PCS device 103 could try to drive bus 107 simultaneously for a read operation. Further, the devices may have different ready and wait state requirements. Thus, the UCS device may have zero wait states and the PCS device could have 3 wait states. When a chip select (such as PCS, LCS or UCS) is decoded to be active, in some microcontroller implementations, assertion of the chip select causes its ready and wait state programming to be placed onto an internal bus within the microcontroller. If two chip selects are decoded in the same space, the ready and wait states of both devices will drive on the internal bus causing contention and unpredictable behavior.
It would be desirable to overlay PCS address space over LCS or UCS address space without sacrificing large portions of the address space and without causing undesirable and unpredictable results.